home *** CD-ROM | disk | FTP | other *** search
- global gLoopList, fileSep
-
- on startMovie
- gLoopList = []
- initMovie()
- repeat with i = 1 to 6
- if soundBusy(i) then
- sound stop i
- end if
- end repeat
- end
-
- on initMovie
- if the machineType = 256 then
- fileSep = "\"
- else
- fileSep = ":"
- end if
- set the keyDownScript to "keyCheck"
- end
-
- on keyCheck
- setVolume()
- end
-
- on setVolume
- inKey = the key
- if (inKey = "q") or (inKey = "Q") then
- go("quitArtRight")
- end if
- if (charToNum(inKey) >= charToNum("0")) and (charToNum(inKey) <= charToNum("9")) then
- newVol = integer(the key)
- if the soundLevel <> newVol then
- set the soundLevel to newVol
- end if
- end if
- end
-
- on deg2radian thisMany
- return thisMany * (2 * PI / 360)
- end
-
- on radian2deg thisMany
- return integer(thisMany * (360 / (2 * PI)))
- end
-
- on flyGravity theBody, thisMass, thatLoc, thatMass, maxRadius, action
- body1 = theBody
- mass1 = thisMass
- gPoint = thatLoc
- gMass = thatMass
- rMax = maxRadius
- mouseMass = thisMass * 2
- mouseLoc = point(the mouseH, the mouseV)
- deltaLoc = mouseLoc - the loc of sprite body1
- dX = getAt(deltaLoc, 1)
- dY = getAt(deltaLoc, 2)
- r = sqrt((dX * dX) + (dY * dY))
- if r = 0 then
- r = 0.01
- end if
- if r > 60 then
- r = 60
- end if
- g = 0.01
- f = g * mass1 * mouseMass / r
- if action = "attract" then
- g = 0.01 * (r * 2.10000000000000009)
- else
- if r < rMax then
- g = -0.01 * (r * 2.10000000000000009)
- else
- g = 0.0
- end if
- end if
- f = g * mass1 * gMass / r
- Fx = 0
- Fy = 0
- if dX <> 0.0 then
- Fx = f * dX / r
- if abs(Fx) > 2000 then
- Fx = 0.0
- end if
- end if
- if dY <> 0.0 then
- Fy = f * dY / r
- if abs(Fy) > 2000 then
- Fy = 0.0
- end if
- end if
- return [#x: Fx, #Y: Fy]
- end
-
- on calcGravity theBody, thisMass
- body1 = theBody
- mass1 = thisMass
- mouseMass = thisMass * 2
- mouseLoc = point(the mouseH, the mouseV)
- deltaLoc = mouseLoc - the loc of sprite body1
- dX = getAt(deltaLoc, 1)
- dY = getAt(deltaLoc, 2)
- r = sqrt((dX * dX) + (dY * dY))
- if r = 0 then
- r = 0.01
- end if
- if r > 60 then
- r = 60
- end if
- g = 0.01
- f = g * mass1 * mouseMass / r
- if dX <> 0.0 then
- Fx = f * dX / r
- if abs(Fx) > 2000 then
- Fx = 0.0
- end if
- end if
- if dY <> 0.0 then
- Fy = f * dY / r
- if abs(Fy) > 2000 then
- Fy = 0.0
- end if
- end if
- return [#x: Fx, #Y: Fy]
- end
-